package com.youyi.yypermissionlibrary.core;

public final class AcpOptions {
    private String mDeniedCloseBtn;
    private String mDeniedMessage;
    private String mDeniedSettingBtn;
    private boolean mDialogCancelable;
    private boolean mDialogCanceledOnTouchOutside;
    private String[] mPermissions;
    private String mRationalBtn;
    private String mRationalMessage;

    private AcpOptions(Builder builder) {
        this.mRationalMessage = builder.mRationalMessage;
        this.mDeniedMessage = builder.mDeniedMessage;
        this.mDeniedCloseBtn = builder.mDeniedCloseBtn;
        this.mDeniedSettingBtn = builder.mDeniedSettingBtn;
        this.mRationalBtn = builder.mRationalBtn;
        this.mPermissions = builder.mPermissions;
        this.mDialogCancelable = builder.dialogCancelable;
        this.mDialogCanceledOnTouchOutside = builder.dialogCanceledOnTouchOutside;
    }

    public String getRationalMessage() {
        return this.mRationalMessage;
    }

    public String getDeniedMessage() {
        return this.mDeniedMessage;
    }

    public String getDeniedCloseBtn() {
        return this.mDeniedCloseBtn;
    }

    public String getDeniedSettingBtn() {
        return this.mDeniedSettingBtn;
    }

    public String getRationalBtnText() {
        return this.mRationalBtn;
    }

    public String[] getPermissions() {
        return this.mPermissions;
    }

    public boolean isDialogCancelable() {
        return this.mDialogCancelable;
    }

    public boolean isDialogCanceledOnTouchOutside() {
        return this.mDialogCanceledOnTouchOutside;
    }

    public static class Builder {
        private static final String DEF_DENIED_CLOSE_BTN_TEXT = "关闭";
        private static final String DEF_DENIED_MESSAGE = "您拒绝权限申请，此功能将不能正常使用，您可以去设置页面重新授权";
        private static final String DEF_DENIED_SETTINGS_BTN_TEXT = "设置权限";
        private static final String DEF_RATIONAL_BTN_TEXT = "我知道了";
        private static final String DEF_RATIONAL_MESSAGE = "此功能需要您授权，否则将不能正常使用";
        private boolean dialogCancelable = false;
        private boolean dialogCanceledOnTouchOutside = false;
        private String mDeniedCloseBtn = DEF_DENIED_CLOSE_BTN_TEXT;
        private String mDeniedMessage = DEF_DENIED_MESSAGE;
        private String mDeniedSettingBtn = DEF_DENIED_SETTINGS_BTN_TEXT;
        private String[] mPermissions;
        private String mRationalBtn = DEF_RATIONAL_BTN_TEXT;
        private String mRationalMessage = DEF_RATIONAL_MESSAGE;

        public Builder setRationalMessage(String str) {
            this.mRationalMessage = str;
            return this;
        }

        public Builder setRationalBtn(String str) {
            this.mRationalBtn = str;
            return this;
        }

        public Builder setDeniedMessage(String str) {
            this.mDeniedMessage = str;
            return this;
        }

        public Builder setDeniedCloseBtn(String str) {
            this.mDeniedCloseBtn = str;
            return this;
        }

        public Builder setDeniedSettingBtn(String str) {
            this.mDeniedSettingBtn = str;
            return this;
        }

        public Builder setPermissions(String... strArr) {
            this.mPermissions = strArr;
            return this;
        }

        public Builder setDialogCancelable(boolean z) {
            this.dialogCancelable = z;
            return this;
        }

        public Builder setDialogCanceledOnTouchOutside(boolean z) {
            this.dialogCanceledOnTouchOutside = z;
            return this;
        }

        public AcpOptions build() {
            String[] strArr = this.mPermissions;
            if (strArr != null && strArr.length != 0) {
                return new AcpOptions(this);
            }
            throw new IllegalArgumentException("mPermissions no found...");
        }
    }
}
